<?php $this->extend('template');?>

<?php $this->start('titre_page'); ?>
	<?php echo __('List_of_countries'); ?>
<?php $this->end(); ?>

<?php $this->start('titre'); ?>
	<h1><?php echo __('List_of_countries'); ?></h1>
<?php $this->end(); ?>

<div class="continents index">

	<?php foreach ($countries as $key => $country):  ?>
			
		<!--On affiche seulement si le pays est bien traduit dans la langue actuelle-->
		<?php //if($country['Country']['locale']): ?>
			<h2>
				<?= $this->Html->link($country['Country']['name'], array(
					'controller' 	=> 'countries',
					'action' 		=> 'view',
					 $country['Country']['idcountries'])); ?>
			</h2>
			
			<?= $this->Html->link($country['Continent']['name'], array(
				'controller' 	=> 'continents',
				'action' 		=> 'view',
				 $country['Continent']['idcontinents'])); ?>
			</br>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('action' => 'view', $country['Country']['idcountries'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $country['Country']['idcountries'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $country['Country']['idcountries']), null, __('Are you sure you want to delete # %s?', $country['Country']['idcountries'])); ?>
			</td>
			</br></br>
		<?php //endif; ?>
	<?php endforeach ?> 

	</br></br>
	<?php
		//Création de la pagination:
		echo $this->Paginator->prev(__('Previous countries'));
		echo ' ';
		echo $this->Paginator->numbers();
		echo ' ';
		echo $this->Paginator->next(__('Next countries'));
	?>
</div>



